package com.cloud.Test;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.cloud.Service.DepartClientService;
import spring.cloud.pojo.Depart;

import java.util.List;

/**
 * @author cyt
 * @create 2020-03-11 21:50
 */
@RestController
public class Controller {

    @Autowired
    private DepartClientService departClientService;

    @RequestMapping("/getFeign")
    public List<Depart> getAll() {
        List<Depart> departs = this.departClientService.queryAll();
        for (Depart depart : departs) {
            System.out.println("depart:" + depart);
        }
        return this.departClientService.queryAll();
    }

    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }
}
